package com.jin.service;

import com.jin.dao.BookMapper;
import com.jin.pojo.Books;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;


@Component
public class BookServiceImpl implements BookService{


    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBooks(Books books) {
        return bookMapper.addBooks(books);
    }

    @Override
    public int deleteBooksById(int id) {
        return bookMapper.deleteBooksById(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public Books selectBooksById(int id) {
        return bookMapper.selectBooksById(id);
    }

    @Override
    public List<Books> selectAllBooks() {
        return bookMapper.selectAllBooks();
    }

    @Override
    public Books selectBooksByName(String bookName) {
        return bookMapper.selectBooksByName(bookName);
    }

}
